require("../db/index");
const { UserModel } = require("../db/model/index");

const UserService = {
  getUser: () => {
    return UserModel.find();
  },
  addUser: (data) => {
    return UserModel.create(data);
  },
  updateUser: (id, data) => {
    return UserModel.findByIdAndUpdate(id, data);
  },
  delUser: (id) => {
    return UserModel.findByIdAndDelete(id);
  },
};

module.exports = UserService;
